<template>
  <!-- 顶部 -->
  <el-form :inline="true" :model="userQuery" class="demo-form-inline">
    <el-form-item label="用户名">
      <el-input v-model="userQuery.name" placeholder="请输入用户名" width="120px" />
    </el-form-item>
    <el-form-item label="工号">
      <el-input v-model="userQuery.code" placeholder="请输入工号" />
    </el-form-item>
    <el-form-item label="电话">
      <el-input v-model="userQuery.tel" placeholder="请输入电话" />
    </el-form-item>
    <el-form-item label="角色">
      <el-select
        v-model="userQuery.roleId"
        placeholder="请选择"
        style="width: 100%"
      >
        <el-option :value="null">空</el-option>
        <el-option
          v-for="item in optionsRole"
          :key="item.id"
          :label="item.name"
          :value="item.id"
        />
      </el-select>
    </el-form-item>
    <el-button type="primary" @click="queryUser">查询</el-button>
  </el-form>
</template>

<script>
export default {
  name: 'Search',
  props: {
    userQuery: {
      require: true,
      type: Object,
      default: () => {
        return {}
      }
    },
    optionsRole: {
      require: true,
      type: Array,
      default: () => {
        return []
      }
    }
  },
  methods: {
    queryUser() {
      this.$emit('queryUser')
    }
  }
}
</script>

<style scoped lang="scss">

</style>
